<details>
  <summary class="ui header">
    <a href="{{ .ctx.Page.RelPermalink }}">{{ .ctx.Page.Title }}</a>
    {{- if not .collapseBySummary -}}&nbsp;{{ T "article" .ctx.Count }}{{- end -}}
  </summary>
  {{- if .collapseBySummary -}}

  <ul>
    {{ range .ctx.Pages.GroupBy "Title" }}
    <details>
      <summary>{{ .Key }}</summary>
      <ul>
        {{ range .Pages }}
        <li>
          <a href="{{ .RelPermalink }}" title="{{ .Summary }}">{{ substr (plainify .Summary) 0 25 }}...</a>
        </li>
        {{ end }}
      </ul>
    </details>
    {{ end }}
  </ul>

  {{- else -}}

  <ul>
    {{ range .ctx.Pages }}
    <li>
      <a href="{{ .Page.RelPermalink }}">{{ .Title }}</a>
    </li>
    {{ end }}
  </ul>

  {{- end -}}
</details>
